﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CyrideTest;

namespace CyrideTest
{
    public partial class MainPage : Form
    {
        Location location;
        public MainPage()
        {
            InitializeComponent();
        }


        private void OK_OnClick(object sender, EventArgs e)
        {
            BusTime busTime = new BusTime(this, location);
            busTime.Owner = this;
            busTime.Show();
            this.Hide();
        }

        private void LstLocation_SelectedIndexChanged(object sender, EventArgs e)
        {
            string SelectedLocation = lstLocation.SelectedItem.ToString();
            if (SelectedLocation.Equals("Ames Middle School"))
            {
                location = new AmesMiddleSchool();
            }
            if (SelectedLocation.Equals("Bessey Hall"))
            {
                location = new BesseyHall();
            }
        }
    }
}